/*
 * Copyright (c) 2010-2013 Ruben Chakhmakhchyan. All rights reserved.
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Eclipse Public License
 * Version 1.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://opensource.org/licenses/EPL-1.0 and read it before using this file.
 */

#include "npobject.h"


void NPObjectAdapter::Deallocate( NPObject *npobj )
{
    // call the virtual destructor
    delete ( NPObjectAdapter* ) npobj;
}

void NPObjectAdapter::Invalidate( NPObject* npobj )
{
    ( ( NPObjectAdapter* ) npobj )->invalidate();
}

bool NPObjectAdapter::HasMethod( NPObject* npobj, NPIdentifier name )
{
    return ( ( NPObjectAdapter* ) npobj )->hasMethod( name );
}

bool NPObjectAdapter::Invoke( NPObject* npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result )
{
    return ( ( NPObjectAdapter* ) npobj )->invoke( name, args, argCount, result );
}

bool NPObjectAdapter::InvokeDefault( NPObject* npobj, const NPVariant *args, uint32_t argCount, NPVariant *result )
{
    return ( ( NPObjectAdapter* ) npobj )->invokeDefault( args, argCount, result );
}

bool NPObjectAdapter::HasProperty( NPObject* npobj, NPIdentifier name )
{
    return ( ( NPObjectAdapter* ) npobj )->hasProperty( name );
}

bool NPObjectAdapter::GetProperty( NPObject* npobj, NPIdentifier name, NPVariant *result )
{
    return ( ( NPObjectAdapter* ) npobj )->getProperty( name, result );
}

bool NPObjectAdapter::SetProperty( NPObject* npobj, NPIdentifier name, const NPVariant *value )
{
    return ( ( NPObjectAdapter* ) npobj )->setProperty( name, value );
}

bool NPObjectAdapter::RemoveProperty( NPObject* npobj, NPIdentifier name )
{
    return ( ( NPObjectAdapter* ) npobj )->removeProperty( name );
}

bool NPObjectAdapter::Enumerate( NPObject* npobj, NPIdentifier **identifier, uint32_t *count )
{
    return ( ( NPObjectAdapter* ) npobj )->enumerate( identifier, count );
}

bool NPObjectAdapter::Construct( NPObject* npobj, const NPVariant *args, uint32_t argCount, NPVariant *result )
{
    return ( ( NPObjectAdapter* ) npobj )->construct( args, argCount, result );
}
